import java.sql.SQLOutput;
import java.util.Scanner;

public class Test {

    public static void main(String[] args) {

        Bookshelf bookshelf=new Bookshelf();

        Scanner sc=new Scanner(System.in);
        System.out.println("请输入你的用户名");
        String name=sc.nextLine();
        int n=0;

        if(name.equals(Administrator.name)){

            System.out.println("*********************");
            System.out.println("*********菜单*********");
            System.out.println("1 add         2 pop");
            System.out.println("3 checkBook   4 amendStatus");
            System.out.println("5 print       6 exit     ");
            System.out.println("*********************");
            System.out.println("*********************");

            do{
                System.out.println("请输入你想进行的操作");
             n=sc.nextInt();

             switch (n){
                 case 1:
                     bookshelf.add();
                     break;
                 case 2:
                     System.out.println("请输入你想要删除的书");

                     String name1=sc.nextLine();


                     bookshelf.pop(name1);
                     break;
                 case 3:
                     bookshelf.checkBook();
                     break;

                 case 4:
                     bookshelf.amendStatus();
                     break;
                 case 5:
                     bookshelf.print();
                     break;
                     case 6:
                         System.out.println("退出系统");
                     break;

                 default:
                     System.out.println("输入错误");


             }
            }while (n!=6);



        }else {

            System.out.println("*********************");
            System.out.println("*********菜单*********");
            System.out.println("1 checkBook     2 borrowBook");
            System.out.println("3 returnBook    4 exit");
            System.out.println("*********************");
            System.out.println("*********************");



            do{
                System.out.println("请输入你想进行的操作");
                n=sc.nextInt();

                switch (n){
                    case 1:
                        bookshelf.checkBook();
                        break;
                    case 2:
                        bookshelf.returnBook();
                        break;
                    case 3:
                        bookshelf.returnBook();
                        break;

                    case 4:
                        System.out.println("退出成功");
                        break;


                    default:
                        System.out.println("输入错误");


                }
            }while (n!=4);


        }








    }
}





